package service;

import com.root.health.bean.UserInfo;
import com.root.health.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {


    @Autowired
    UserMapper userMapper;

    public UserInfo getUserbyName(String username){

        return userMapper.getUser(username);
    }//获取登录用户信息
    public UserInfo getUserbyId(long userid){

        return userMapper.getUserById(userid);
    }//通过id获取用户信息
    public void userUpd(String username, String password, String phone, String realname, String role, String gender,long userid){
        userMapper.userUpd(username,password,phone,realname,role,gender,userid);
    }//修改用户信息
//    public Boolean UserRole(UserInfo userInfo){
//
//        return userMapper.Role(userInfo);
//    }//判断用户角色
}
